package www.dianbaozu.com.ui

import android.os.Bundle
import androidx.activity.viewModels
import dagger.hilt.android.AndroidEntryPoint
import www.dianbaozu.com.R
import www.dianbaozu.com.databinding.ActivityContractBinding
import www.dianbaozu.com.ui.my.ContractFragment
import www.wen.com.common.lib.base.activity.BaseLoadingActivity
import www.wen.com.common.lib.base.module.BaseViewModel
import www.wen.com.common.lib.data.entities.ContractEntity
import www.wen.com.common.lib.helper.loading.KeyHelper


/**
 * 服务、协议页面
 */
@AndroidEntryPoint
class ContractActivity : BaseLoadingActivity<ActivityContractBinding>() {

    private lateinit var mContractEntity: ContractEntity

    override fun getLayout(): Int = R.layout.activity_contract

    private val mViewModel by viewModels<ProxyViewModel>()

    override val viewModel: BaseViewModel
        get() = mViewModel

    override fun initialize() {
        mContractEntity = intent.getParcelableExtra(KeyHelper.BUNDLE_DATA)!!
        val fragment = ContractFragment()
        val bundle  =Bundle()
        bundle.putParcelable(KeyHelper.BUNDLE_DATA, mContractEntity)
        fragment.arguments = bundle

        supportFragmentManager.beginTransaction().add(R.id.container, fragment).commitAllowingStateLoss()
    }

}